# $Id: PKGBUILD 182056 2013-04-06 00:13:50Z eric $
# Maintainer: Andrea Scarpino <andrea@archlinux.org>
# Contributor: Jaroslav Lichtblau <dragonlord@aur.archlinux.org>
# Contributor: Hugo Doria <hugodoria at gmail.com>

pkgname=translate-toolkit
pkgver=1.10.0
pkgrel=1
pkgdesc="A toolkit to convert between various different translation formats, help process and validate localisations"
arch=('any')
url="http://translate.sourceforge.net/wiki/toolkit/index"
license=('GPL')
depends=('bash' 'python2-lxml')
optdepends=('python2-iniparse: to use ini2po script')
source=("http://downloads.sourceforge.net/translate/${pkgname}-${pkgver}.tar.bz2")
md5sums=('91ef9ec6e997f8cd5379fb1e44ce2063')

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  sed -i -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \
    -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
    $(find . -name '*.py')

  python2 setup.py install --root="${pkgdir}" --optimize=1
  mv "${pkgdir}"/usr/lib/python2.7/site-packages/{docs,share} "${pkgdir}"/usr/lib/python2.7/site-packages/translate
}
